import base from '@/api/baseurl';
import request from '@/utils/request'

/**
 * 查询账户册组成因子列表
 * @param {*} query
 * @returns
 */
export function findTREAdjustmentFactor(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/TREAdjustmentFactor/findTREAdjustmentFactor',
    method: 'get',
    params: query
  })
}

/**
 * 因子类型下拉框
 * @param {*} query
 * @returns
 */
export function findfactortype(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/AccountCompositionFactor/findfactortype',
    method: 'get',
    params: query
  })
}


/**
 * 单条删除因子
 * @param {*} query
 * @returns
 */
export function deleteTREAdjustmentFactor(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/TREAdjustmentFactor/deleteTREAdjustmentFactor',
    method: 'get',
    params: query
  })
}

/**
 * 添加新因子
 * @param {*} data
 * @returns
 */
export function addTREAdjustmentFactor(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/TREAdjustmentFactor/addTREAdjustmentFactor',
    method: 'post',
    data
  })
}

/**
 * 修改因子内容
 * @param {*} data
 * @returns
 */
export function updateTREAdjustmentFactor(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/TREAdjustmentFactor/updateTREAdjustmentFactor',
    method: 'post',
    data
  })
}

/**
 * 多行删除
 * @param {*} data
 * @returns
 */
export function deleteTREAdjustmentFactorBatch(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/TREAdjustmentFactor/deleteTREAdjustmentFactorBatch',
    method: 'post',
    data
  })
}


/**
 * 获取转移收支的因子编号
 * @param {*} query
 * @returns
 */
export function addadjFtCode(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/TREAdjustmentFactor/addadj_ft_code',
    method: 'get',
    params: query
  })
}